
array pg_fetch_assoc ( resource $result [, int $row ] )


<?php
$conn = pg_connect("dbname=publisher");
if (!$conn) {
	echo "An error occurred.\n";
	exit;
}

$result = pg_query($conn, "SELECT id, author, email FROM authors");
if (!$result) {
	echo "An error occurred.\n";
	exit;
}

while ($row = pg_fetch_assoc($result)) {
	echo $row['id'];
	echo $row['author'];
	echo $row['email'];
}
?>